{% extends "base.html" %}

{% block head_title %}
{%- if postView -%}
  @{{ postView.Author.Handle }} on Bluesky
{%- else -%}
  Bluesky
{%- endif -%}
{% endblock %}

{% block html_head_extra -%}
{%- if postView -%}
  <meta property="og:type" content="article">
  <meta property="profile:username" content="{{ profileView.Handle }}">
  {%- if requestURI %}
  <meta property="og:url" content="{{ requestURI }}">
  {% endif -%}
  {%- if postView.Author.DisplayName %}
  <meta property="og:title" content="{{ postView.Author.DisplayName }} (@{{ postView.Author.Handle }})">
  {% else %}
  <meta property="og:title" content="@{{ postView.Author.Handle }}">
  {% endif -%}
  {%- if postText %}
  <meta name="description" content="{{ postText }}">
  <meta property="og:description" content="{{ postText }}">
  {% endif -%}
  {%- if imgThumbUrls %}
  {% for imgThumbUrl in imgThumbUrls %}
  <meta property="og:image" content="{{ imgThumbUrl }}">
  {% endfor %}
  <meta name="twitter:card" content="summary_large_image">
  {%- elif postView.Author.Avatar %}
  {# Don't use avatar image in cards; usually looks bad #}
  <meta name="twitter:card" content="summary">
  {% endif %}
  <meta name="twitter:label1" content="Posted At">
  <meta name="twitter:value1" content="{{ postView.IndexedAt }}">
  <meta name="article:published_time" content="{{ postView.IndexedAt }}">
  <meta name="article:published_time" content="{{ postView.IndexedAt }}">
  <link rel="alternate" type="application/json+oembed" href="https://embed.bsky.app/oembed?format=json&url={{ postView.Uri | urlencode }}" />
{% endif -%}
{%- endblock %}

{% block noscript_extra -%}
{%- if postView -%}
<div id="bsky_post_summary">
  <h3>Post</h3>
  <p id="bsky_display_name">{{ postView.Author.DisplayName }}</p>
  <p id="bsky_handle">{{ postView.Author.Handle }}</p>
  <p id="bsky_did">{{ postView.Author.Did }}</p>
  <p id="bsky_post_text">{{ postText }}</p>
  <p id="bsky_post_indexedat">{{ postView.IndexedAt }}</p>
</div>
{% endif -%}
{%- endblock %}
